Skip to content

JustCall SMS Integration

Complete SMS solution integrating JustCall with Odoo - Unified inbox, click-to-chat, multi-line support.

Field Value
Technical Name justcall_sms
Version 15.0.2.0.0
Category Productivity/Communication
Dependencies base, mail, contacts, crm, sale, fieldservice, jdx_field_service_automation

Overview

This module integrates JustCall SMS/Voice with Odoo ERP to provide:

  • Unified SMS Inbox - View all SMS from all lines in one place
  • Click-to-Chat - Click any phone number in Odoo to open conversation
  • Partner Linking - Auto-match SMS to Odoo contacts
  • Multi-Line Support - Multiple phone lines (Sales, Support, Operations)
  • MMS Support - View pictures/videos with thumbnail preview
  • Chatter Integration - SMS appears in partner timeline
  • Real-time Webhooks - Receive SMS instantly
  • Daily Backup Sync - Automatic API sync as fallback
  • SMS Templates - Predefined message templates

Phone Lines

Phone lines are configurable via Odoo settings. Each line has a type and can be set as default for sending.

Line Type Purpose Icon
sales Sales and inquiries fa-phone
support Customer service fa-headset
operations Installation/Operations fa-wrench

Features

SMS Inbox View

+------------------------------------------------------------------+
|  SMS Inbox                                                        |
+------------------------------------------------------------------+
|  Lines:                                                           |
|  [All (7,246)] [Sales (3,986)] [Support (1,033)] [Operations]     |
|                                                                   |
|  Filter: [All] [Incoming] [Today]         Search...              |
+------------------------------------------------------------------+
|  Line    | Contact          | Dir | Date     | Message            |
|----------|------------------|-----|----------|-------------------|
|  Sales   | John Smith       | <-  | Dec 3    | Thanks Will...    |
|  Sales   | Jane Doe         | ->  | Dec 3    | Hey there...      |
|  Ops     | Kevin Chang      | <-  | Dec 2    | What time?        |
+------------------------------------------------------------------+

Click Phone -> SMS Popup

From any page with a phone field, click to open conversation:

  • View full SMS history with customer
  • Select line for sending
  • Send new messages directly

Partner Form - SMS Tab

Dedicated SMS tab on contact form showing:

  • Complete SMS history
  • Filter by line
  • Quick access to send SMS

Chatter Integration

SMS messages automatically appear in partner chatter:

  • Incoming SMS shows as customer message
  • Outgoing SMS shows as user message
  • MMS includes clickable media links

MMS / Media Support

Media Type Icon Preview
Image (JPEG/PNG/GIF) fa-image Thumbnail
Video (MP4/3GPP) fa-video-camera Play button
Audio (MP3/MPEG) fa-music Audio player
PDF fa-file-pdf-o Link

Data Models

justcall.config

Singleton model for API configuration.

Field Type Description
name Char Configuration name
api_key Char JustCall API Key
api_secret Char JustCall API Secret
default_line_id Many2one Default line for sending
webhook_base_url Char Public URL for webhooks
webhook_secret Char Optional signature verification
webhook_last_received Datetime Last webhook timestamp

justcall.line

Field Type Description
name Char Line name (Sales, Support, etc.)
phone Char Phone number (E.164 without +)
phone_display Char Formatted display number
line_type Selection sales / support / operations
icon Char FontAwesome icon class
is_default Boolean Default for sending
sms_count Integer Computed SMS count

justcall.sms

Field Type Description
id Integer JustCall SMS ID (primary key)
contact_number Char Customer phone
contact_name Char Customer name
justcall_number Char JustCall line number
justcall_line_name Char Line name
direction Selection Incoming / Outgoing
body Text Message content
sms_date Date Message date
sms_time Char Message time
delivery_status Char Delivery status
is_mms Boolean Has media attachment
mms_urls Text Media URLs (JSON array)
partner_id Many2one Linked Odoo contact
raw_json Text Original API response

justcall.sms.template

Field Type Description
name Char Template name
body Text Message template
sequence Integer Display order

Configuration

1. API Credentials

Navigate to Settings > JustCall SMS > Configuration:

  1. Click "Create" or edit existing
  2. Enter API credentials:
  3. API Key: From JustCall dashboard
  4. API Secret: From JustCall dashboard
  5. Click "Test Connection" to verify

2. Webhook Setup

Configure webhook for real-time SMS:

  1. Enter Webhook Base URL:
  2. Development: https://abc123.ngrok.io
  3. Production: https://your-domain.com
  4. Copy the generated webhook endpoint
  5. Add to JustCall dashboard: Settings > Webhooks > Add Webhook
  6. Configure events: sms.received, sms.sent, sms.delivered

Webhook Endpoint: /justcall/webhook/sms

Webhook Security:

Optional signature verification using X-JustCall-Signature header with HMAC-SHA256.

3. Phone Lines

Navigate to Settings > JustCall SMS > Phone Lines:

  1. Click "Create"
  2. Fill in fields:
Field Description Example
Name Display name "Sales Line"
Phone Number without + "15125551234"
Type Line purpose sales / support / operations
Icon FontAwesome class "fa-phone"
Is Default Default for sending True/False

4. Via XML Data

For automated deployment:

<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data noupdate="1">
        <record id="justcall_line_sales" model="justcall.line">
            <field name="name">Sales</field>
            <field name="phone">15125551234</field>
            <field name="line_type">sales</field>
            <field name="icon">fa-phone</field>
            <field name="is_default">True</field>
        </record>

        <record id="justcall_line_support" model="justcall.line">
            <field name="name">Customer Support</field>
            <field name="phone">15125555678</field>
            <field name="line_type">support</field>
            <field name="icon">fa-headset</field>
        </record>

        <record id="justcall_line_ops" model="justcall.line">
            <field name="name">Operations</field>
            <field name="phone">15125559012</field>
            <field name="line_type">operations</field>
            <field name="icon">fa-wrench</field>
        </record>
    </data>
</odoo>

5. Via Python Script

# Run in Odoo shell: docker compose exec odoo odoo shell -d DATABASE_NAME
env = self.env

lines_data = [
    {'name': 'Sales', 'phone': '15125551234', 'line_type': 'sales', 'is_default': True},
    {'name': 'Support', 'phone': '15125555678', 'line_type': 'support'},
    {'name': 'Operations', 'phone': '15125559012', 'line_type': 'operations'},
]

for line in lines_data:
    existing = env['justcall.line'].search([('phone', '=', line['phone'])])
    if not existing:
        env['justcall.line'].create(line)
        print(f"Created line: {line['name']}")

env.cr.commit()

Sync Methods

Real-time Webhook (Primary)

SMS are received instantly via webhook when configured.

Supported Events:

Event Description
sms.received Incoming SMS
sms.sent Outgoing SMS sent
sms.delivered Delivery confirmation

Daily API Sync (Backup)

Cron job runs daily to catch missed webhooks:

# Manual sync (last 48 hours)
docker compose exec odoo odoo shell -d DATABASE_NAME
>>> env['justcall.sms'].sync_from_api(hours=48)

Cron Configuration:

  • Runs daily at 2:00 AM
  • Syncs last 48 hours of messages
  • Skips duplicates automatically

Partner Matching

Auto-match SMS to Odoo contacts:

# Match all unmatched SMS to partners
docker compose exec odoo odoo shell -d DATABASE_NAME
>>> env['justcall.sms'].action_match_all_partners()

Chatter Sync

Post SMS to partner chatter:

# Sync SMS to partner chatter
docker compose exec odoo odoo shell -d DATABASE_NAME
>>> env['justcall.sms'].action_sync_to_chatter(limit=1000)

Sending SMS

Via Python

# Get config
config = env['justcall.config'].get_config()

# Send SMS
result = config.send_sms(
    to_number='+15125551234',
    body='Hello from Odoo!',
    from_number='+15129999999',  # Optional, uses default line
    media_url='https://example.com/image.jpg',  # Optional for MMS
)

Via SMS Templates

Pre-configure templates for quick sending:

  1. Navigate to Settings > JustCall SMS > SMS Templates
  2. Create templates with placeholders
  3. Use templates in send wizard

Security Groups

Group Access
SMS User Read SMS, Send SMS
SMS Manager Full access, Configuration
Sales User View own partner SMS

Module Structure

justcall_sms/
├── __manifest__.py
├── __init__.py
├── controllers/
│   ├── __init__.py
│   └── webhook.py              # Webhook endpoint
├── data/
│   ├── justcall_line_data.xml  # Default lines
│   ├── mail_data.xml           # Mail subtypes
│   ├── server_actions.xml
│   ├── ir_cron_data.xml        # Daily sync cron
│   └── sms_template_data.xml
├── models/
│   ├── __init__.py
│   ├── justcall_config.py      # API configuration
│   ├── justcall_line.py        # Phone lines
│   ├── justcall_sms.py         # SMS messages
│   ├── justcall_sms_template.py
│   ├── res_partner.py          # Partner extensions
│   ├── crm_lead.py             # CRM extensions
│   ├── sale_order.py           # Sales extensions
│   ├── fsm_order.py            # FSM extensions
│   └── mail_message.py         # Chatter extensions
├── security/
│   ├── security.xml            # Security groups
│   └── ir.model.access.csv     # Access rights
├── static/
│   └── src/
│       ├── js/phone_sms_widget.js
│       └── css/phone_sms_widget.css
├── views/
│   ├── justcall_config_views.xml
│   ├── justcall_line_views.xml
│   ├── justcall_sms_views.xml
│   ├── justcall_sms_template_views.xml
│   ├── res_partner_views.xml
│   ├── crm_lead_views.xml
│   ├── sale_order_views.xml
│   ├── fsm_order_views.xml
│   └── menus.xml
└── wizard/
    ├── __init__.py
    └── sms_conversation_wizard.py

Troubleshooting

Webhook Not Receiving SMS

  1. Check webhook URL is accessible: curl https://your-domain/justcall/webhook/test
  2. Verify webhook is configured in JustCall dashboard
  3. Check Odoo logs: docker compose logs odoo | grep JustCall
  4. Ensure nginx/proxy forwards POST requests

SMS Not Matching Partners

  1. Verify phone format matches (last 10 digits)
  2. Run bulk partner matching:
    env['justcall.sms'].action_match_all_partners()
    

Missing Recent SMS

  1. Check webhook status in configuration
  2. Run manual sync:
    env['justcall.sms'].sync_from_api(hours=24)
    

API Connection Failed

  1. Verify API credentials in configuration
  2. Test connection button in settings
  3. Check JustCall API status

API Reference

JustCall API v2.1

Base URL: https://api.justcall.io/v2.1

Authentication:

Authorization: {api_key}:{api_secret}

Endpoints Used:

Endpoint Method Purpose
/texts/new POST Send SMS
/texts/list GET List SMS history
/phone-numbers GET List phone numbers